/**
 * Created by Administrator on 2016/11/15.
 */
//json.dian     点击的元素
//json.number     点击的数量
hgNews.dian = function(json){
    console.log($.cookie("uid"));
    console.log($.cookie("session_id"));
    json.dian.one("click",function(){
        //if ($.cookie("uid")&& $.cookie("session_id")){    //todo 是否登陆
        //if ($.cookie("uid")&& $.cookie("session_id")){    //todo 是否赞过
        if (true){
            $(this).addClass("red");
            $("img",this).attr("src","img/sdsd2_03.png");
            var add = parseInt($(json.number,this).text())+1;
            $(".add",this).fadeIn();
            $(json.number,this).text(add);
            $(".add",this).fadeOut();
            $.ajax({
                type:"post",
                url:todo,//todo
                dataType:"json",
                data:comment,//todo
                error: function (jqXHR, textStatus, errorThrown) {//进行错误信息的处理
                    /*弹出jqXHR对象的信息*/
                    /*弹出其他两个参数的信息*/
                    console.log(textStatus);
                    console.log(errorThrown);
                },
                success:function(data){
                    console.log(data);
                    if (data.status == 1){

                    }else {
                        alert("data.status="+data.status);
                    }
                }
            });
        }else {
            window.location.href = "register1.html";
        }
    });

};
